import { Controller, Get, Post, Body, Patch, Param, Delete, Query } from '@nestjs/common';
import { WaybillService } from './waybill.service';
import { ListWaybillDto } from './dto';
import { RequirePermission } from 'src/common/decorator/require-perm.decorator';
import { User, UserDto } from '../user/user.decorator';
import { ResultData } from 'src/common/utils/result';

@Controller('waybill')
export class WaybillController {
  constructor(private readonly waybillService: WaybillService) {}

  @Get('list')
  @RequirePermission('system:enterprise:waybill:list')
  async findAll(@Query() query: ListWaybillDto, @User() user: UserDto) {
    const result = await this.waybillService.findAll(query, user);
    return ResultData.ok(result);
  }
}
